package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        //File file = new File("./demo.txt");
        //File file = new File("E:\\FZJ\\demo.txt");
        //File file = new File("E:/FZJ/demo.txt");
        File file = new File("demo.txt");
        System.out.println("文件名："+file.getName());//获取文件名
        System.out.println("文件长度："+file.length());
        System.out.println("文件是否可读："+file.canRead());
        System.out.println("文件是否可写："+file.canWrite());
        System.out.println("文件是否隐藏："+file.isHidden());
    }
}
